Function: getScript(stringOrPathArray, objectConfig, domElement) Description: Loads one or more external scripts into the current document. Returns: Null. Note: When a callback function is defined, it will exicute after all resources complete loading. When boolDisableAsync is set to true, scripts will load in the order they have been called. Though the elementContainer parameter defaults to document.head, it can be set to any DOM-node container element within the document. When defer is set to true, all processing will wait until the page has finished loading before loading the specified resources. Parameter 1: External Resources The external resources parameter may contain an absolute or relative file path string, or it may contain an array of multiple file paths. Parameter 2: Configuration Properties { // Load asynchronously with multithreading. disableAsync: false, // Default // Defer script execution until after the page completes loading. defer: false, // Default // Execute a callback after all external resources complete loading. callback: function(containerElement, resource) { // Do something after the external resources load. } } Example: // Fetch an external script to load into the page. $A.getScript("path/resource.js"); // Fetch an array of external scripts to load into the page asynchronously. $A.getScript([ "path/resource1.js", "path/resource2.js", "path/resource3.js" ]); // Fetch an array of external scripts to load into the page synchronously. $A.getScript([ "path/resource1.js", "path/resource2.js", "path/resource3.js" ], { disableAsync: true }); // Fetch an external script to load into the page then exicute a callback. $A.getScript("path/resource.js", { callback: function() { // Do something } }); // Fetch an array of external scripts to load into the page asynchronously and exicute a callback. $A.getScript([ "path/resource1.js", "path/resource2.js", "path/resource3.js" ], { callback: function() { // Do something. } }); // Fetch an array of external scripts to load into the page synchronously and exicute a callback. $A.getScript([ "path/resource1.js", "path/resource2.js", "path/resource3.js" ], { disableAsync: true, callback: function() { // Do something. } });